import { hideLoading } from '@/plugins/index'
import { router } from '@/routers/index'

import App from './App.vue'
import { permission } from './directives/permission' // 导入自定义权限指令
import { i18n } from './locales/index'

import './styles/css/default.css'

async function bootstrap() {
  const app = createApp(App)
  // 挂载i18n
  app.use(i18n)
  // 使用 Pinia 状态管理
  app.use(createPinia())
  // 挂载router
  app.use(router)
  // 注册自定义指令
  app.directive('permission', permission)
  // 挂载vue
  app.mount('#app')
  // 删除loading
  hideLoading()
}

bootstrap()
